export default function ({ req, redirect, route, store }) {
  let keys = ['Googlebot', 'bingbot', 'Baiduspider'];
  let isboot = false;
  try {
    if (req) {
      for (let i = 0; i < keys.length; i++) {
        if (
          req.headers['user-agent']
            .toLowerCase()
            .includes(keys[i].toLowerCase())
        ) {
          isboot = true;
        }
      }
    }
  } catch {}
  if (isboot) {
    return redirect(`/${store.state.app.language}/news`);
  }
}
